<template>
  <el-container class="container">
    <el-main class="main" align="center">
      <el-result
        icon="success"
        title="您已完成测试"
      >
      </el-result>
      <el-row class="row">
        成绩：{{ score }} 分
      </el-row>
      <el-row class="row" v-if="pass === 'true'">
        恭喜通过！入群码为：{{ code }}
        <br>
        注意：入群码仅供最初填写的QQ号使用，且只能使用一次
      </el-row>
      <el-row class="row" v-else>
        {{ msg }}
      </el-row>
      <el-row class="row">
        <el-button type="primary" @click="retry">再来一次</el-button>
      </el-row>
    </el-main>
  </el-container>
</template>

<script lang="ts" setup>
import { useRoute, useRouter } from 'vue-router'

const route = useRoute()
const router = useRouter()
const score = route.params.score
const pass = route.params.pass
const code = route.params.code
const msg = route.params.msg
const retry = () => {
  router.push({
    name: 'Main'
  })
}
</script>

<style scoped>
.main {
  padding-top: 100px;
  height: 100%;
}

.row {
  font-size: 20px;
  padding-bottom: 20px;
  justify-content: center;
}
</style>
